﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.ServiceProcess;
using System.Text;
using Netcare.Core;

namespace Netcare.Agent
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            App.InitializeAppDomainAndLogger();

            // start service
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] 
			{ 
				new TService() 
			};
            ServiceBase.Run(ServicesToRun);
        }



        private static string GetRunningDir()
        {
            return Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
        }


        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Log.WriteException(e.ExceptionObject as Exception, "Unhandled exception happened!");
        }

    }
}
